﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <script type="text/javascript" src="js/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <script src="js/template.js"></script>
    <script type="text/javascript">
        var webSite = "http://api.hexfuture.com";
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
        var exercisePoolId = getUrlParam("exercisePoolId");
        $.ajax({
            type: "get",
            dataType: "json",//4295865427
            url: webSite + "/ExerciseContents/SearchEChapters?exercisePoolId=" + exercisePoolId + "&ssotoken=Jiyuan",
            success: function (data) {
                //var exePoolId = getUrlParam("exercisePoolId");
                var html = ""
                for (var i = 0; i < data.resEChs.length; i++) {
                    html += "<li><a href='/getHte/exercisePoolId=" + exercisePoolId + "&echapterid=" + data.resEChs[i].Key + "&eChapterName="+data.resEChs[i].Name+"'>" + data.resEChs[i].Name + "</a></li>";
                }
                //var html = template('eChapterlist', data);

                $("#content").html(html);
            }
        });
    </script>

    <!--<script id="eChapterlist" type="text/html">
        
            {{each resEChs as value index}}
            <li><a href="/getHte/exercisePoolId={{value.exercisePoolId}}?echapterid={{value.Key}}">{{value.Name}}</a></li>
            {{/each}}
        
    </script>-->
</head>

<body>
    <nav>
        <ul class="pagination" id="content"></ul>
    </nav>
</body>

</html>